﻿<?php
include 'lanewechat.php';
$openid = (string)$_GET['openid'];
$id = $_GET['id'];
$start = isset( $_GET['start'] ) ? $_GET['start'] : date('Y-m-d');
$end = isset( $_GET['end'] ) ? $_GET['end'] : '';
$list = \LaneWeChat\Core\Common::getReport( $openid , $id , $start , $end );
if( $id == 'Rpt_Vip_Log' ){
    $title = '消费记录';
}
else{
    $title = '充值记录';
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>鹏企科技</title>
    <meta name="keywords" content="鹏企科技">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1,initial-scale=1.0, maximum-scale=1.0,user-scalable=0">
    <meta name="renderer" content="webkit">
    <link rel=Stylesheet type="text/css" href="css/common.css">
    <link rel=Stylesheet type="text/css" href="css/style.css">
</head >

<body >


<div class="container">

    <div class="header"><img src="images/arrow.png"><?=$title?></div>


    <div class="spendRecord">
        <form method="get" action="">
            <input type="hidden" name="id" value="<?=$id?>">
            <input type="hidden" name="openid" id="openid" value="<?=$openid?>">
            <div><input type="date" placeholder="开始时间" name="start" value="<?=$start?>" />
                <input type="date" name="end" placeholder="结束时间" value="<?=$end?>" />
                <input type="submit" value="搜索"></div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <?php
            if( !isset($list['data'][2]) && empty( $list['data'][2] ) ){
                ?><h3>暂无数据~</h3><?php
            }
            else{
                foreach( $list['data'] as $key => $row ){
                    if( $key == 0 ) continue;
                    ?><tr><?php foreach ($row as $r){
                        if( $r == 'SN' ) $r='序号';
                        ?><td style="width:25%;"><?=mb_substr($r,0,10);?></td><?php } ?></tr><?php
                }
            }

            ?>
        </table>
        </form>
    </div>


</div>


<div class="footer"><img src="images/logo.png">本服务由上海鹏企自动化科技有限公司提供</div>

</div>



<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
    $('.recharge-sel a').click(function(){
        $('.recharge-sel a').removeClass('on');
        $(this).addClass('on');
    });
</script>
</body>
</html>
